<?php
class UserModel extends RelationModel{
    public $table='user';
    public $relation=array(
        'user_info'=>array(
            'type'=>HAS_ONE,
            'foreign_key'=>'user_id',
            'parent_key'=>'uid'
        ),
        'news'=>array(
            'type'=>HAS_MANY,
            'foreign_key'=>'user_id',
            'parent_key'=>'uid'
        )
    );
}